home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 8T8UDX (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  2.8 KB  |  62 lines

  1. package java.awt.image;
  2.  
  3. import java.util.Hashtable;
  4.  
  5. public class ImageFilter implements ImageConsumer, Cloneable {
  6.    protected ImageConsumer consumer;
  7.  
  8.    public Object clone() {
  9.       try {
  10.          return super.clone();
  11.       } catch (CloneNotSupportedException var1) {
  12.          throw new InternalError();
  13.       }
  14.    }
  15.  
  16.    public ImageFilter getFilterInstance(ImageConsumer ic) {
  17.       ImageFilter instance = (ImageFilter)this.clone();
  18.       instance.consumer = ic;
  19.       return instance;
  20.    }
  21.  
  22.    public void imageComplete(int status) {
  23.       this.consumer.imageComplete(status);
  24.    }
  25.  
  26.    public void resendTopDownLeftRight(ImageProducer ip) {
  27.       ip.requestTopDownLeftRightResend(this);
  28.    }
  29.  
  30.    public void setColorModel(ColorModel model) {
  31.       this.consumer.setColorModel(model);
  32.    }
  33.  
  34.    public void setDimensions(int width, int height) {
  35.       this.consumer.setDimensions(width, height);
  36.    }
  37.  
  38.    public void setHints(int hints) {
  39.       this.consumer.setHints(hints);
  40.    }
  41.  
  42.    public void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize) {
  43.       this.consumer.setPixels(x, y, w, h, model, pixels, off, scansize);
  44.    }
  45.  
  46.    public void setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize) {
  47.       this.consumer.setPixels(x, y, w, h, model, pixels, off, scansize);
  48.    }
  49.  
  50.    public void setProperties(Hashtable props) {
  51.       props = (Hashtable)props.clone();
  52.       Object o = props.get("filters");
  53.       if (o == null) {
  54.          props.put("filters", this.toString());
  55.       } else if (o instanceof String) {
  56.          props.put("filters", (String)o + this.toString());
  57.       }
  58.  
  59.       this.consumer.setProperties(props);
  60.    }
  61. }
  62.